
<template>
  <h1>newB:{{ newB.name }}</h1>
  <h1>v.obj.name:{{newB.obj.name}}</h1>
</template>
<script setup lang="ts" name="Count">
import { reactive, markRaw } from 'vue'


const b = markRaw({ name: 'zll', age: 10, obj: { name: '小红' } })
const newB = reactive(b)
setTimeout(()=>{
newB.name = 'e'
newB.obj.name = '小三'
// 已经更改，但是不会引起视图发生变化，因为markRaw标记的对象将失去响应式，常用于mock数据
console.log('newB,',newB)
},2000)
</script>
